package br.factory.parametro;

import java.lang.reflect.Field;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import br.interfaces.Persistente;

public class FactoryParametroInteger extends FactoryParametro {

	@Override
	public void setParametro(PreparedStatement preparedStatement, Object parametro, int sequencia) throws SQLException {
		Integer param = (Integer)parametro;
		preparedStatement.setInt(sequencia, param);
		System.out.println("preparedStatement.setInt("+sequencia+", "+parametro+");");
	}

	@Override
	public void getParametro(String campo, Field field, Persistente objeto, ResultSet rs) throws Exception {
		field.set(objeto, rs.getInt(campo));
	}

}
